<?php 

namespace App;

use Illuminate\Database\Eloquent\Model;
use DB;

class Link extends Model
{
	//友情链接列表
	public function show(){
		$data=DB::table('friend_link')->paginate(2);
		return $data;

	}

	//显示友情链接
	public function del_a($link_id){
		$data=DB::table('friend_link')->where('link_id',$link_id)->update(['status'=>0]);
		return $data;

	}

	//不显示友情链接
	public function del($link_id){
		$data=DB::table('friend_link')->where('link_id',$link_id)->update(['status'=>1]);
		return $data;
	}


	//添加友情链接
	public function add($arr){
		$data=DB::table('friend_link')->insert($arr);
		return $data;
	}


	//修改需要查的单行数据
	public function find($link_id){
		$data=DB::table('friend_link')->where('link_id',$link_id)->first();
		return $data;
	}

	//修改友情链接
	public function up($id,$arr){
		$data=DB::table('friend_link')->where('link_id',$id)->update($arr);
		return $data;
	}


}
 ?>